﻿#pragma once

#include "../../MirControls/MirImageControl.h"
#include "../../MirControls/MirButton.h"
#include "../../MirControls/MirLabel.h"
#include "../../MirControls/MirControl.h"
#include <string>
#include <unordered_map>
#include <vector>
#include <any>
#include "../../../stringhelper.h"

//C# TO C++ CONVERTER NOTE: Forward class declarations:
namespace Client::MirScenes::Dialogs { class HelpPage; }

using namespace Client::MirControls;
using namespace Client::MirGraphics;
using namespace Client::MirNetwork;
using namespace Client::MirObjects;
using namespace Client::MirSounds;
namespace S = ServerPackets;
namespace C = ClientPackets;

namespace Client::MirScenes::Dialogs
{
    class HelpDialog final : public MirImageControl
    {
    public:
        std::vector<HelpPage*> Pages = std::vector<HelpPage*>();

        MirButton *CloseButton, *NextButton, *PreviousButton;
        MirLabel *PageLabel;
        HelpPage *CurrentPage;

        int CurrentPageNumber = 0;

        virtual ~HelpDialog()
        {
            delete CloseButton;
            delete NextButton;
            delete PreviousButton;
            delete PageLabel;
            delete CurrentPage;
        }

        HelpDialog();

    private:
        void LoadImagePages();


    public:
        void DisplayPage(const std::string &pageName);

        void DisplayPage(int id = 0);


        void Toggle();
    };

    class ShortcutPage1 : public ShortcutInfoPage
    {
    public:
        ShortcutPage1();
    };
    class ShortcutPage2 : public ShortcutInfoPage
    {
    public:
        ShortcutPage2();
    };
    class ShortcutPage3 : public ShortcutInfoPage
    {
    public:
        ShortcutPage3();
    };

    class ShortcutInfo
    {
    private:
        std::string Shortcut;
        std::string Information;

    public:
        std::string getShortcut() const;
        void setShortcut(const std::string &value);
        std::string getInformation() const;
        void setInformation(const std::string &value);

        ShortcutInfo(const std::string &shortcut, const std::string &info);
    };

    class ShortcutInfoPage : public MirControl
    {
    protected:
        std::vector<ShortcutInfo*> Shortcuts = std::vector<ShortcutInfo*>();

    public:
        ShortcutInfoPage();

        void LoadKeyBinds();
    };

    class HelpPage : public MirControl
    {
    public:
        std::string Title;
        int ImageID = 0;
        MirControl *Page;

        MirLabel *PageTitleLabel;

        virtual ~HelpPage()
        {
            delete Page;
            delete PageTitleLabel;
        }

        HelpPage(const std::string &title, int imageID, MirControl *page);

    private:
        void HelpPage_BeforeDraw(std::any sender, EventArgs *e);
    };
}
